You can call the function KCCreateKeychain to create a new keychain. KCCreateKeychain asks for a pointer to the password string that will be used to protect the new keychain, and a pointer to the keychain reference indicating where it should create the new keychain. You can pass
NULL
for both parameters. If you pass
NULL
for the password string, the Keychain Setup dialog box will be displayed to obtain it. In this case, the keychain is automatically unlocked after creation. If you pass a keychain reference whose location is unspecified or invalid,
KCCreateKeychain
creates the new keychain in the Keychains folder.
After you are finished with a keychain reference, you should call the function KCReleaseKeychain to dispose of the memory it occupied. On return, KCReleaseKeychain sets the reference to
NULL
. You should not use it after this.